<template>
	<view>
		<view class="page">
		<view class="top" :style="`padding-top:`+$store.state.StatusBar.statusBar + `px`">
			<view class="top-icon"   @click="back">
				<image class="img"
					src=""
					mode="aspectFill"></image>
			</view>
			<view class="top-title" >{{title}}</view>
		</view>
		<view class="body" :style="`margin-top:`+$store.state.StatusBar.statusBar + `px`">
				<view class="title">
					认证信息仅用于实名认证，知遇会严格保密
				</view>
				<view class="list">
					<view class="item">
						<view class="label">真实姓名</view>
						<view>
							<input v-model="realName" type="text" placeholder="请输入姓名">
						</view>
					</view>
					<view class="item">
						<view class="label">身份证号</view>
						<view>
							<input v-model="idNum" type="text" placeholder="请输入身份证号">
						</view>
					</view>
				</view>
				<view class="button" @click="submit">立即认证</view>
				<view class="mark">
					<p>一个身份信息只能绑定一个账号</p>
					<p>证件信息绑定后不能修改，请填写本人实名信息，如非本人实名信息</p>
					<p>将无法提现(提交后请使用本人支付宝账号)</p>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {to} from '@/utils/index.js';
	export default {
		data() {
			return {
				title: '实名',
				info: {},
				idNum: '',
				realName: ''
			}
		},
		onLoad(option) {
			
		},
		onShow(option){
			this.getInfo();
		},
		methods: {
			to,
			back(){
				to()
			},
			async getInfo(){
				// let res = await this.$c.post("/app/exchange/getList")
				// if(res.code != 0){
				// 	uni.navigateTo({
				// 	  url: '/im/login/login'
				// 	});
				// }
				// this.info = res.data
			},
			async submit(){
				let res = await this.$c.post("/app/auth/realNameAuthIos?idNum="+this.idNum+"&realName="+this.realName)
				if(res.code != 0){
					uni.showToast({
						title: res.msg,
						icon: "none"
					})
					return;
				}
				uni.showToast({
					title: "提交成功",
					icon: "none"
				})
				setTimeout(()=>{
					// this.getInfo()
					this.$router.go(0)
				},1000)
			}
		}
	}
</script>

<style scoped lang="scss">
	.page {
		width: 100vw;
		padding:30rpx;
		height: 100vh;
		// background: linear-gradient(#e3ecfb, #fdedf0, #fff, #fff);
	}
	.top {
		position: fixed;
		top: 0rpx;
		width: 100%;
		// background-color: #e3ecfb;
		z-index: 999;
		text-align: center;
		vertical-align: middle;
		padding:10rpx;
	}
	.top-icon {
		position: absolute;
		left: 30rpx;
		z-index: 99;
		width: 30rpx;
		height: 30rpx;
	}
	.top-title {
		line-height: 50rpx;
		display: block;
		height:50rpx;
		z-index: 99;
	}
	.body{
		padding-top:40rpx;
		text-align: center;
		.title{
			margin-top:40rpx;
			font-size:24rpx;
		}
		.button{
			background-color: #aa8c72;
			color:#fff;
			display: inline-block;
			padding:30rpx 0rpx;
			border-radius: 30rpx;
			font-size:32rpx;
			width:80%;
			margin-top:30rpx;
		}
		.mark{
			width:100%;
			margin-top:30rpx;
			text-align: left;
			font-size: 20rpx;
			color: #9d9395; 
		}
		.list{
			margin-top:60rpx;
			.item{
				height:80rpx;
				padding:15rpx;
				position: relative;
				.label{
					position: absolute;
					left: 40rpx;
				}
			}
		}
	}

</style>